import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'clueDepart'
})
export class clueDepartPipe implements PipeTransform {
  // public clueSource: any;
  transform(value: any, args?: any): any {
    
  let depart=JSON.parse(window.sessionStorage.getItem('areaData'));
  let areaList:any[]=[]; 
  for(let i = 0;i<depart.length;i++){
    if(depart[i].orgTypeName == "机构"){
      areaList.push({regdepname:depart[i].orgName,regdepvalue:depart[i].orgId})
    }
  }
    let val = areaList.filter(item=>{
       return item.regdepvalue == value
      })
      return val[0].regdepname;
    }
}
 